<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    let num;
    if (num) {
        console.log(111111)
    }
    let numnull = null
    console.log(typeof numnull);


    let result = true;
    console.log(result);

    //字符串

    let st2 = '中文a';
    console.log(st2.length);//3 || 7

    console.log(st2[0]);
    let str3 = 'abc';
    //首字符转大写
    let str4 = str3[0].toUpperCase() + str3.substr(1);
    console.log(str4);
    //对象展开的方式 ...
    //对象展开也可以把字符串转成数组
    let str5 = [...str3];
    console.log(str5);
    str5[0] = str5[0].toUpperCase();
    console.log(str5.join(''));
    //字符串反转
    console.log(str3.split("").reverse().join(""));
    //charAt 返回指定位置的字符
    console.log(str3.charAt(1));
    //substr
    let str6 = 'studyjava.png';
    console.log(str6.substr(5));
    console.log(str6.substr(-3));
    console.log(str6.substr(-3, 2));
    //split
    let arrStr = "html,java,css,js,php";
    console.log(arrStr.split(","))
    //join
    console.log(arrStr.split(",").join("-"));

    let str7 = 'study'; // study
    let str8 = str7 + ' js'; // study js

    //number
    //number的上限
    console.log(Number.MAX_VALUE)
    console.log(0.1 + 0.2);

    let numstr = '101';
    console.log(Number(numstr));

    //undefined 转为 NaN，null 转为 0
    let numstr2 = null;
    console.log(Number(numstr2));


    let num10 = '0';

    if (num10) {//
       console.log('true 或是 false')
    }

    let num11 = 'ASS';

    if (Number(num11)) {//
       console.log('Nan true 或是 false')
    }




</script>

</html>